package com.hualan.web;

import com.hualan.pojo.*;
import com.hualan.service.service.service.HotCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/courses")
public class HotCourseController {
    @Autowired
    private HotCourseService hotCourseService;
    @RequestMapping("/findAll")
    public List<HotCourse> findAll(){
        return hotCourseService.findAll();
    }

    @RequestMapping("/findById")
    public List<HotCourse> findById(Integer id){
        System.out.println("==========");
        System.out.println(id);
        return hotCourseService.findById(id);
    }

    @RequestMapping("/like")
    List<HotCourse> findLike(String name){
        return hotCourseService.findLike(name);
    }
    @RequestMapping("/imgs")
    List<CourseLunBo> lunbotus(){
        return hotCourseService.lunbotus();
    }

    @RequestMapping("/xuzhi")
    List<XuZhi> xuzhis(Integer cid){
        return hotCourseService.xuzhis(cid);
    }

    @RequestMapping("/teacher")
    Teachers teacher(Integer id){
        return hotCourseService.teacher(id);
    }
    @RequestMapping("/pingjia")
    List<PingJia> pingjia(Integer cid){
        System.out.println("========================================");
        System.out.println(cid);
        return hotCourseService.pingjia(cid);
    }
}
